package com.juqimiao.raccoon.commodity.context;

import com.juqimiao.linn.context.ContextObject;
import com.juqimiao.linn.context.BusinessPoint;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * Tenant Type normally ensure the BusinessPoint and operation rights.
 *
 * @author Collin Cai
 *
 */
@Data
public class TenantContext extends ContextObject {
    private String userId;
    private String tenantId;
    private BusinessPoint businessPoint = BusinessPoint.createDefault();

    public TenantContext(String userId, String tenantId, BusinessPoint businessPoint) {
        this.userId = userId;
        this.tenantId = tenantId;
        this.businessPoint = businessPoint;
    }

    public TenantContext(String userId, String tenantId) {
        this(userId, tenantId, BusinessPoint.createDefault());
    }
}
